ROOTFS_DIR = /nfs/rootfs

MODULE_NAME = dev_led_plat
MODULE_NAME2 = drv_led_plat

#APP_NAME = test_led_plat
APP_NAME1 = client
APP_NAME2 = server

CROSS_COMPILE = /home/chh001/package/gcc-4.6.4/bin/arm-none-linux-gnueabi-
CC = $(CROSS_COMPILE)gcc
CC2 = gcc

ifeq ($(KERNELRELEASE), )

KERNEL_DIR = /home/chh001/kernel/linux-4.14.8

CUR_DIR = $(shell pwd)

all:
	make -C $(KERNEL_DIR) M=$(CUR_DIR) modules
#	$(CC) $(APP_NAME).c -o $(APP_NAME)
	$(CC2) $(APP_NAME1).c -o $(APP_NAME1)
	$(CC) $(APP_NAME2).c -o $(APP_NAME2)
clean:
	make -C $(KERNEL_DIR) M=$(CUR_DIR) clean
install:
	cp -raf *.ko $(APP_NAME1) $(APP_NAME2) $(ROOTFS_DIR)/drv_module
else
obj-m += $(MODULE_NAME).o
obj-m += $(MODULE_NAME2).o


endif
